﻿<%@ Page Language="C#" AutoEventWireup="true" Inherits="FL.Web.BackEnd.DataGrid" %>

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title></title>
    <style>
        html, body {
            margin: 0;
            padding: 5px;
            border: 0;
            width: 100%;
            height: 100%;
            overflow: hidden;
        }

        .col1 {
            float: left;
            width: 25%;
        }

        .col2 {
            float: left;
            width: 50%;
        }

        .query_table {
            width: 100%;
        }

        .label {
            width: 90px;
            text-align: right;
        }

        .exp {
            width: 60px;
        }

            .exp > select {
                width: 60px;
            }
    </style>
</head>
<script src="../../SFramework/boot.js"></script>
<script src="../../SFramework/linq.js"></script>
<script src="../../SFramework/linq.min.js"></script>
<script> var currentUser = <%=FL.Common.Globals.ObjectToJSON(User)%>;//当前登录人员工id
</script>
<body style="margin: 0px; padding: 0px">

    <form id="form1" runat="server">
        <div style="width: 100%; height: 100%">
            <div class="mini-toolbar" style="border-bottom: 0; padding: 0px;">
                <table style="width: 100%;">
                    <tr>
                        <td style="width: 100%;" id="tool_button_bar">
                            <div id="button_bar"><%=BtnItems %></div>
                        </td>
                        <td style="white-space: nowrap;" id="toolbarhtml"><%=ToolbarHtml %></td>
                        <td style="white-space: nowrap;"><a class="mini-button" iconcls="icon-expand" plain="true" onclick="showQuery()" id="btnHQuery">查询</a></td>
                        <td style="white-space: nowrap;">
                            <input type="checkbox" id="checkAndOr" /><span style="margin-top: -5px;">并集</span>
                            <input id="QueryContext" type="text" />
                            <%-- <a class="mini-button" onclick="fnQuciklyQuery()">查询</a>--%>
                        </td>
                    </tr>
                </table>
                <div id="QueryItem" style="display: none;">
                    <table style="width: 100%;">
                        <tr>
                            <td style="width: 100%;">
                                <div><%=QueryHtml %></div>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <div style="width: 99.9999%; text-align: center; border-top: #808080 1px solid; padding-top: 5px; padding-bottom: 5px; margin: 0px;">
                                    <a class="mini-button" iconcls="icon_close" onclick="fnEmptyQuery()">清空</a><a class="mini-button" iconcls="icon_close" onclick="fnCloseQuery()" onkeypress="">关闭</a><a class="mini-button" iconcls="icon_find" onclick="fnHightLevelQuery()">查询</a>
                                </div>
                            </td>
                        </tr>
                    </table>
                </div>
            </div>
            <div id="datagrid1" class="mini-datagrid" pagesize="<% =GetStringFromQueryString("pagesize","50") %>" allowresize="true" allowscroll="true" allowcelledit="<%=AllowEdit.ToString().ToLower()%>" allowcellselect="<%=AllowEdit.ToString().ToLower()%>" multiselect="true"
                editnextonenterkey="true" editnextrowcell="true" idfield="id" multiselect="<%=GetStringFromQueryString("selectMode","true")%>" url="../data/jsondata.aspx?action=sql&functionid=<%=GetStringFromQueryString("functionid","") %>&entity=<%=EntityName%>&condition=<%=Condition %>&order=<%=Order%>&desc=<%=GetStringFromQueryString("desc","Yes") %>&datagrid=true&totalfields=<%=GetStringFromQueryString("totalfields","")%>&r=1" pagesize="1000" showsummaryrow="<%=GetStringFromQueryString("totalfields","")==""?"false":"true" %>" ondrawsummarycell="onDrawSummaryCell">
                <div property="columns">
                    <div type="indexcolumn" width="25"></div>
                    <%if (GetStringFromQueryString("IsShowCheckColumn", "Yes") == "Yes")
                      {%>
                    <div type="checkcolumn" width="25"></div>
                    <%} %>
                    <%=DataFields %>
                    <%--<div field="group_id" width="120" type="comboboxcolumn" headeralign="center" allowsort="true">类型
                        <input property="editor" class="mini-combobox" style="width:100%;" data="FeeType" />
                    </div>--%>
                </div>
           
            </div>
        </div>
        <div id="popupMenu" class="mini-menu" style="display:none;"><%=BtnItems %></div>
    </form>
</body>
<script type="text/javascript">
   var  const_action = "sql",
    const_entityID = "<% =EntityId %>",    //实体ID名称
    const_entityName = "<% =EntityName %>",//实体名称
    const_EditEntity = "<% =EditEntity %>",//编辑实体名
    const_ViewEntity = "<% =this.GetStringFromQueryString("View_Entity","")%>",
    const_functionId   ="<% =FunctionID %>",//自定义条件
    const_Order ="<% =Order %>",           //排序  
    const_UserId = "<% = UserId %>",       // 
    const_TreeCustomCondition = "";        //主从关系条件 
    const_QueryField="<% =QuciklyQueryFields %>",
    const_CustomCondition = encodeURI("<% =DefineCondition %>"),//查询方案条件
    const_Condition = encodeURI("<% =Condition %>"),//
    const_TreeCustomCondition = "";
    const_PageTitle=encodeURI("<% =PageTitle %>"),
    _openWindowHeight=<%=EditWindowHeight%>,
    _openWindowWidth=<%=EditWindowWidth%>,
    _mergeCols = "<%=GetStringFromQueryString("mergeCols","") %>",
    _noNeedLoadData="<%=GetStringFromQueryString("noNeedLoadData","0")%>";
    <% =ColumnDataSource%>

</script>

<script type="text/javascript">

    $("#datagrid1").width($(document).width());
    $("#datagrid1").height($(document).height() - 37);
    var grid = null;
    // $("#datagrid1").height($(document).height() - (35+2));
    $(document).ready(function(){

        if($(".mini-toolbar").height()>37)
        {
            $("#button_bar").hide();
            $('<a class="mini-menubutton" plain="true" menu="#popupMenu" style="width:60px">按钮</a>').insertBefore("#button_bar");
        } 
        else{
            $("#button_bar").removeClass();
            $("#button_bar").show();
        }
        mini.parse();
        grid= mini.get("datagrid1")
        // var mergeCols = getPar("mergeCols");
        if(_mergeCols!="")
        {
            grid.on("load", function () {
                grid.mergeColumns(_mergeCols.split(","));
            });
        }
        else{
            if(_noNeedLoadData=="0")
            {
                grid.load();
            }
        }

    });

  
    //var frozen =getPar("frozen");
    //if(frozen!="")
    //{
    //    eval("grid.frozenColumns ("+frozen+")");
    //}
    //$("input[id^='code']");//id属性以code开始的所有input标签 
    //$("input[id$='code']");//id属性以code结束的所有input标签 
    //$("input[id*='code']");//id属性包含code的所有input标签 
    //grid.frozenColumns (3,4);

</script>
<script src="../../Scripts/hotkey.js"></script>
<script src="../../Scripts/datagrid/list.common.button.js"></script>
<script src="../../Scripts/common/jquery.action.js"></script>
<script src="../../Scripts/common/jquery.data.js"></script>
<script>

</script>
<script>
    <% =List_self_script %>
</script>
<script src="../../Scripts/hotkey.js"></script>
<script src="../../Scripts/common/juqery.Keyborad.js"></script>
<script src="../../scripts/app/list/<%=EntityName %>.list.js?g=<%=Guid.NewGuid() %>"></script>
</html>
